<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文章列表</title>
    <link rel="stylesheet" href="./libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/main.css">
    <script src="./libs/jquery-1.12.4.min.js"></script>
    <!-- 1.3.1 引入模板引擎js文件 -->
    <script src="./libs/template-web.js"></script>
    <!-- 用 layUI 实现更好的用户体验 -->
    <link rel="stylesheet" href="./libs/layui/css/layui.css">
    <script src="./libs/layui/layui.js"></script>
    <!-- 引入公共的js文件和当前页面的js文件 -->
    <script src="./js/public.js"></script>
    <script src="./js/article_list.js"></script>
</head>

<body>
    <div class="container-fluid">
        <div class="common_title">
            文章列表
        </div>
        <div class="container-fluid common_con">
            <div class="row opt_btns">
                <div class="col-xs-6">
                    <form class="form-inline">
                        <select id="selCategory" name="" class="form-control input-sm">
                            
                        </select>
                        <select id="selStatus" name="" class="form-control input-sm">
                            <option value="">所有状态</option>
                            <option value="草稿">草稿</option>
                            <option value="已发布">已发布</option>
                        </select>
                        <button id="btnSearch" class="btn btn-default btn-sm">筛选</button>
                    </form>
                </div>
                <div class="col-xs-6">
                    <a href="article_release.html" class="btn btn-success btn-sm pull-right" id="release_btn">发表文章</a>
                </div>
            </div>
            <table class="table table-striped table-bordered table-hover mp20">
                <thead>
                    <tr>
                        <th>标题</th>
                        <th>作者</th>
                        <th>分类</th>
                        <th class="text-center">发表时间</th>
                        <th class="text-center">状态</th>
                        <th class="text-center" width="100">操作</th>
                    </tr>
                </thead>
                <tbody>
                    
                </tbody>
            </table>
            <!-- 预留给分页器准备的 -->
            <div id="pager" class="row text-center">
            </div>
        </div>
    </div>
    <!-- 1.3.2 定义模板 -->
    <script id="temp_tr" type="text/html">
        {{ each data v }}
        <tr>
            <td>{{ v.title }}</td>
            <td>{{ v.author }}</td>
            <td>{{ v.category }}</td>
            <td class="text-center">{{ v.date }}</td>
            <td class="text-center">{{ v.state }}</td>
            <td class="text-center">
                <!-- 🧨注意：打开文章编辑的时候，把文章 id 设置到地址栏中 -->
                <a href="./article_edit.html?id={{ v.id }}" class="btn btn-default btn-xs">编辑</a>
                <a href="javascript:void(0);" data-id="{{ v.id }}" class="btn btn-danger btn-xs btn_delete">删除</a>
            </td>
        </tr>
        {{ /each }}
    </script>
    <!-- 2.0 类别列表模板 -->
    <script id="cate_item" type="text/html">
        <!-- 所有分类不需要列表渲染 -->
        <option value="">所有分类</option>
        {{ each data v}}
        <option value="{{ v.id }}">{{ v.name }}</option>
        {{ /each }}
    </script>
</body>

</html>